value = umod(value*4); in this example, the image is turned into 4 bands from black to white. This can be useful in creating wood patterns. value = 1; This example clears the selection to white. value = 0; This example sets the image to black. value = sqrt((x-0.5)*(x-0.5)+(y-0.5)*(y-0.5)); This command creates a circular gradation with black in the center. value = lerp(usin(x), usin(y), 0.5); This command creates a simple halftone cell. red = pow(red, 0.7); green = pow(green, 0.7); blue = pow(blue, 0.7); This command lightens the image using gamma correction. mask = max(red, max(green, blue)); This command computes the brightest of the red, green, and blue channels (for each pixel) and stores it into the mask. value = min(0.1, value); This command limits the minimum luminance of an image to 0.1. value = step(value + ynoise, 1); This creates horizontal random stripes and thresholds the image, rendering it in a sketchy style. value = xnoise; This creates vertical random stripes in the image which vary in intensity. value += noise*0.2 - 0.1; In this example 20 percent noise is added to the lightness of the image, creating a stippled effect. This is hue-protected noise. hue = y; When running this example in a photograph, a spectrum of colors runs vertically through the image. value = x; When running this example in a white image, a left-to-right ramp from black to white is created. value = usin(x*2); In this example the parentheses are used to surround the single parameter to the usin function. red = (green + blue) / 2; In this example, the green component is added to the blue component of the image before being divided by two and then stored into the red component of the image. hue = lerp(x, y, 0.5); In this example, the pixel x and y positions are parameters to the lerp function. Note the use of parentheses to enclose the parameters. red = 1; green = 0; In this example, the statements are run sequentially. First the red component of the image is set to 1 (full red) and then the green component of the image is set to 0 (no green). red /= green; divides the green component of the image into the red component of the image. blue *= green; multiplies the green component of the image into the blue component of the image. red -= noise; subtracts noise from the red component of the image. blue += green; adds the green component of the image into the blue component of the image. red = red / 2; divides red by 2 and stores the result in the red component of the image red = x * y; multiplies the x and y location fractions of the pixel position within the image and stores the result in the red component of the image. blue = hue - value; subtracts the value component from the hue component of the image and stores the result into the blue component of the image. blue = red + green; adds the red and green components of the image and stores the result into the blue component of the image. red = 1; assigns the value 1 into the red component of the image. If the value of the right hand side expression of the assignment is outside the range 0 through 1, it is clipped onto range before storing. red = cc_red; green = cc_green; blue = cc_blue; This example fills the selection with the current color. c_black = 0; This drops away the black plate for the background image behind the floater. mask = 0.5 * max(c_cyan, max(c_magenta, c_yellow)); This command computes a 50% GCR black channel for the background image into the floating mask. c_magenta = 0; When operating on a floater, this sets the magenta component of the image behind the selection to zero. red = c_cyan; green = c_magenta; blue = c_yellow; mask = c_black; When you select all and option-click to float a whole copy of an image, this command lets you separate an image into process color. c_value *= value; Here the value component of the floater is multiplied into the value (brightness) of the image behind it. c_saturation = value; Here the value (brightness) of the floater is stored into the saturation component of the image beneath it. c_hue = hue; Here the hue of the floater is stored into the hue of the image beneath it. c_mask = min(c_mask, mask); Here, the mask of a floater is included in the image mask beneath it. Note: 0 mask means "inside". c_red -= red; c_green -= green; c_blue -= blue; In this example, the floater is subtracted from the image beneath it. c_red *= red; c_green *= green; c_blue *= blue; In this example, the floater is composited using multiply. c_red = lerp(red, c_red, c_mask); In this example, just the red part of the floater is dropped. black = 0; In this example, the black plate is dropped. yellow = sqrt(yellow); In this example, the yellow plate is increased considerably. magenta -= 0.2; In this example, twenty percent is subtracted from the magenta plate. cyan += 0.1; In this example, ten percent is added to the cyan plate. value = 1 - value; Running this example on a color photograph will create a negative look where the hue is preserved. saturation = 0; Running this example on a color photograph will convert it to grayscale. red = 1; green = 0; blue = 0; hue = x; In this example, the color is set up to pure red in the first three statements. The last statement varies hue across the image horizontally, creating a spectrum. mask = blue * (1 - green); In this example, the blue component of the image is multipled by the inverse of the green parameter and stores into the mask. blue = noise; In this example the blue component of the image is replaced noise ranging between 0 (no blue) through 1 (100% blue). Note that this has no effect on the red and green components. green = 0.5; In this example the green component of the image is replaced with a flat value of 50% green. Note that this has no effect on the red and blue components. red = x; In this example the red component of the image is replaced with a ramp going from 0 at left to 1 at right. Note that this has no effect on the green and blue components.